package com.xuecheng.manage_cms.controller;

import com.xuecheng.framework.web.BaseController;
import com.xuecheng.manage_cms.service.PageService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @author ShengJinFeng
 * @version V1.0
 * @ClassName CmsPagePreviewController
 * @Description (这里用一句话描述这个类的作用)
 * @date 2020/1/28 16:22
 * @since V1.0
 */
@Controller
@Api(tags = "页面预览接口",description = "页面预览接口")
public class CmsPagePreviewController extends BaseController {

    @Autowired
    private PageService pageService;

/*    @ApiOperation("页面预览")
    @RequestMapping(value = "/cms/preview/{pageId}",method = RequestMethod.GET)
    public void preview(@PathVariable("pageId")String pageId){
        String pageHtml = pageService.getPageHtml(pageId);
        if (StringUtils.isNotBlank(pageHtml)){
            try {
                ServletOutputStream outputStream = response.getOutputStream();
                response.setHeader("Content-type","text/html;charset=utf-8");
                outputStream.write(pageHtml.getBytes("utf-8"));
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }*/
}
